/*
 * $Id$
 */
package net.sourceforge.wurfl.core.utils;

/**
 * 
 * 
 * @author Filippo De Luca
 * @version $Id$
 */
public class OrdinalStringIndexer implements StringIndexer {

	private final String needle;
	
	private final int ordinal;
	
	public OrdinalStringIndexer(final String needle, int ordinal) {
		this.needle = needle;
		this.ordinal = ordinal;
	}

	public int getIndex(String target) {

		return org.apache.commons.lang.StringUtils.ordinalIndexOf(target, needle, ordinal);
	}

}
